#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: util.py 
@version:
@time: 2023/04/13 
"""
import time
from functools import wraps


def run_time(func):
    @wraps(func)
    def this(*args, **kwargs):
        pre = time.time()
        func(*args, **kwargs)
        end = time.time()
        print(f'run time is{end - pre}s')

    return this


def async_run_time(func, *args):
    pre = time.time()
    import asyncio
    asyncio.run(func(*args))
    end = time.time()
    print(f'run time is{end - pre}s')
